PICTButton is a CDEF (control definition) that allows you to use pictures as buttons instead of the drab black and white buttons that you are used to. You can use it just about anywhere. I've tested it on various machines. I've included a sample application that shows the CDEF in action.
VERSION HISTORY
1.0.7 - now works over multiple monitors of different bit depths
1.0.6 - removed unnecessary erasing code
1.0.5 - really fixed problem with black and white PICTs showing up properly
1.0.4 - changed color of text in variation 2 to blue
1.0.3 - fixed a problem with black and white PICTs showing up, or so I thought
1.0.2 - fixed the new variations
1.0.1 - added variations 1 and 2
1.0.0 - initial release
INSTRUCTIONS
To use the CDEF, copy the CDEF resource into your project's resource file.
Then, create CNTLs with the following settings:
The BoundsRect should correspond to where you want to PICT to be displayed in your dialog.
Value should be the resource ID of the PICT you want as the default for the button. For example, you might use PICT ID 1000. In this case, the following table tells you what pictures you need and what they are used for:
1000 - default color
1001 - inverted color (when you click and hold on the control)
1002 - default black and white (for when your monitor's bit depth is 1)
1003 - inverted black and white
Visible should be set to true.
Max and Min should be set to zero, since they don't mean anything to PICTButton.
ProcID should be set to (CDEF ID * 16) + Variation. I've set the CDEF ID to 36, so in most cases, the ProcID should be set to 576. There are two additional variations available. Variation 1 will display the title of the CNTL in the center of the PICT. Variation 2 will draw a two pixel wide line around the PICT. To use variation 1, set the ProcID to 577. To use variation 2, set the ProcID to 578.
RefCon should be set to zero.
Title can be set to anything you like. It will only be used if you use variation 1.
If you do not have a PICT of a certain ID and the CDEF is looking for it, things will probably not work correctly. If PICTButton does not work on your setup, I would certainly like to hear about it.
You may use PICTButton CDEF in any public domain, freeware, shareware, or commercial product. I would appreciate a copy of any product in which it is used. Credit would also be nice, though I don't require it.
Bugs, gripes, comments, etc. should be sent to me (Paul Celestin) at one of the following addresses: